<html>
<head>
<TITLE>CSE5317/4305 Project #1</TITLE>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<center>
<H1>CSE5317/4305 Project #1 (Scanner)</H1>
Due Monday February 4 before 11:59pm<p>
Worth 6% of your project grade
</center>
<p>
<hr>
<p>
The purpose of this project is to construct a scanner for PCAT using Jlex.
Read the <A HREF="http://www.cs.princeton.edu/~appel/modern/java/JLex/current/manual.html">JLex manual</a>,
the scanner <a href="calc/calc.lex"><tt>calc.lex</tt></a> for the simple calculator,
and the <a href="pcat04.pdf">PCAT manual</a>.
<p>
If you work on Linux, you need to download the archive file 
<a href="pcat.tar">pcat.tar</a> on your home directory and unpack it using <tt>tar xvf pcat.tar</tt>.
If you work on Windows, you need to download the zip file <a href="pcat.zip">pcat.zip</a>
and unzip it on your home directory.
The top-level <tt>pcat</tt> directory contains the file <a href="pcat/pcat.lex">pcat.lex</a>,
plus some other files that you will need for the next projects.
Inside this directory there is another directory <tt>tests</tt>
that contains the PCAT test files for your scanner.
For this project, you should only modify the file <tt>pcat.lex</tt> that contains your scanner.
<p>
<b>Important:</b> Write information about all members of your team in the <tt>pcat/README</tt> file
(full name and four last digits of student ID).
<p>
The tokens that your scanner needs to recognize are given at the top of the file <a href="pcat/pcat.gen"><tt>pcat.gen</tt></a>.
To handle comments, you will need to use the state <tt>comment</tt> in JLex (ie, at the beginning
of a comment you jump to the state <tt>comment</tt>, while at the end of a comment you jump back to the initial state).
<p>
To compile the Java files in the directory <tt>pcat</tt>, run the script:
<pre>
build
</pre>
Then, to use your scanner on a PCAT source file <tt>tests/hello.pcat</tt>, run:
<pre>
run 1 hello
</pre>
where <tt>1</tt> indicates that you are testing the first project.
The output will consist of the tokens produced by your scanner
and the error messages (if any).
You also need to compare your output with that of the solution:
<pre>
solution 1 hello
</pre>
You need to test your scanner against <b>all</b> the test files <tt>*.pcat</tt> in the
directory <tt>tests</tt>.
<p>
After ensuring that your program compiles and executes
correctly, cleanup your <tt>pcat</tt> directory by running
<pre>
clean
</pre>
Then, if you are using Linux, archive your file using <tt>tar cvf pcat.tar pcat</tt>.
If you are using Windows, zip the whole directory into the file <tt>pcat.zip</tt>.
Then submit your file (<tt>pcat.tar</tt> or <tt>pcat.zip</tt>) here:
<p>
<form enctype="multipart/form-data" action="/cgi-bin/php/handin.php" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
    <input type="hidden" name="class" value="cse5317" />
    <input type="hidden" name="assignment" value="proj1" />
Submit this file: <input name="userfile" type="file" size="50"/><br/>
    <input type="submit" value="Send File" />
</form>
<p>
Note that you may submit your file as many times as you like, but only the most recently submitted
file will be retained.
<p>
<hr>
<P>
<ADDRESS>Last modified: 01/09/08 by <A HREF="http://lambda.uta.edu/">Leonidas Fegaras</A></ADDRESS>
